package com.yunxi.order.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 远程调用墨迹天气 API
 * FeignClient 注解标注了 url 后，代表该类里面的所以远程调用都是针对这个 url
 * <p>
 * 墨迹天气官网：<a href="https://www.mojicb.com/">墨迹天气</a>
 *
 * @author: lidy
 * @date: 2025-01-18 12:02
 */
@FeignClient(value = "weather-service", url = "http://aliv18.data.moji.com/")
public interface WeatherFeignClient {

    @PostMapping("/whapi/json/alicityweather/condition")
    String getWeather(@RequestHeader("Authorization") String auth,
                      @RequestParam("token") String token,
                      @RequestParam("cityId") String cityId);

}
